/*
  infer: infer表示在extends条件语句中以占位符出现的等到使用时才推断出的数据类型
*/
interface Customer {
  custname: string;
  buymoney: number;
}

type CustFn = (params: Customer) => string;
type CustParameterType = CustFn extends (params: infer R) => string ? R : never;
type CustReturnType = CustFn extends (params: Customer) => infer R ? R : never;

type ParamsType<T> = T extends (...params: infer R) => any ? R : never;
type CustParamType = ParamsType<CustFn>;

type EleOfArr<T> = T extends Array<infer R> ? R : never;
type EleofArrTest = EleOfArr<Array<{ name: string; age: number }>>;

export {};
